package cn.edu.scau.sec.rw.controllers;

import cn.edu.scau.sec.rw.view.DeviceUI;
import cn.edu.scau.sec.rw.view.File_DiskUI;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;

import javax.swing.text.html.ImageView;
import java.net.URL;
import java.util.ResourceBundle;

public class ClientController implements Initializable {

    @FXML
    private AnchorPane Apane;

    @FXML
    private Button disk;

    @FXML
    private Button process;

    @FXML
    private Button memory;

    @FXML
    private Button min;

    @FXML
    private Button close;

    @FXML
    private Button hardware;

    @FXML
    void close(MouseEvent event) {
        if(event.getButton().name().equals(MouseButton.PRIMARY.name()))
            Platform.exit();//关闭窗口
    }

    @FXML
    void minimize(MouseEvent event) {
        CommonBridge.primaryStage.setIconified(true);
    }

    @Override
    public void initialize(URL location, ResourceBundle resources) {

        disk.setOnAction(event -> new File_DiskUI() );

        process.setOnAction(event -> {

        });

        memory.setOnAction(event -> {

        });

        hardware.setOnAction(event ->
            new DeviceUI()
        );
    }
}
